package com.huang.unsafe;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

/*
*   等价于  Map<String, Object> map = new HashMap<>(16,0.75);
*
*
* */
public class HashMapTest {
    public static void main(String[] args) {
       // HashMap<String, Object> map = new HashMap<>();
        Map<String, Object> map = new ConcurrentHashMap<>();
        for (int i = 0; i < 30; i++) {
            new Thread(()->{
                map.put(Thread.currentThread().getName(),UUID.randomUUID().toString().substring(0,5));
                System.out.println(map);
            }).start();
        }


    }
}
